<?php

namespace App\Services\CloseUnpaidProductOrder;

use App\Http\Controllers\Api\V1\Requests\FormRequest;

class CloseUnpaidProductOrderRequest extends FormRequest
{
	public function rules()
	{
		$this->verify();
		
		return [];
	}
	
	public function verify()
	{
		$order = $this->order;
		
		if ($order->isClosed()) fail('目标订单已关闭');
		
		if ($order->isPaid()) fail('目标订单已支付');
		
		return true;
	}
}
